<?php

class Conexao {

    private static $con;

    static function conectar() {        
        try {            
            if (is_null(self::$con)) {
                self::$con = new PDO('mysql:host=' . HOST . ';dbname=' . DB, USER, PASS, array( 1002 => 'SET NAMES utf8'));
            }           
            return self::$con;
        } catch (PDOException $e) {
            print $e->getMessage();
        }
    }
}